package com.hqyj.shop.controller;


import com.hqyj.shop.pojo.Car;
import com.hqyj.shop.service.CarService;
import com.hqyj.shop.util.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author rock
 * @since 2024-10-14 01:58:48
 */
@RestController
@RequestMapping("/car")
public class CarController {

    @Autowired
    CarService carService;
    //添加购物车
    @GetMapping("/addCar")
   public ResultVo addCar(Car c, HttpServletRequest request){
        return carService.addCar(c,request);
    }
    //删除购物车
    @GetMapping("/delCar")
    public ResultVo delCar(Car c, HttpServletRequest request){
        return carService.delCar(c,request);
    }
    //修改购物车
    @GetMapping("/updateCar")
    public ResultVo updateCar(Car c, HttpServletRequest request){
        return carService.updateCar(c,request);
    }
    //查询购物车
    @GetMapping("/queryCar")
    public ResultVo queryCar(HttpServletRequest request){
        return carService.queryCar(request);
    }

}

